/* eslint-disable no-unused-vars */

import { createRouter, createWebHashHistory } from 'vue-router'
import '@/views/homepage/HomePage.vue'
import '@/views/login/Login.vue'

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    component: () => import('@/views/login/Login.vue'),
    hidden: true,
    meta: {
      title: '登录',
      icon: 'dashboard',
      public: true
    }
  },
  {
    path: '/homepage',
    component: () => import('@/views/homepage/HomePage.vue'),
    redirect: '/homepage/welcome',
    meta: {
      title: '首页',
      icon: 'dashboard',
      public: true
    },
    children: [
      {
        path: 'welcome',
        component: () => import('@/views/Welcome.vue'),
        meta: { title: '欢迎页' }
      },
      {
        path: 'userList',
        component: () => import('@/views/userList/UserList.vue'),
        meta: { title: '用户列表' }
      },
      {
        path: 'userAdd',
        component: () => import('@/views/userList/UserAdd.vue'),
        meta: { title: '添加用户' }
      },
      {
        path: 'providerList',
        component: () => import('@/views/provider/ProviderList.vue'),
        meta: { title: '供应商列表' }
      },
      {
        path: 'providerAdd',
        component: () => import('@/views/provider/ProviderAdd.vue'),
        meta: { title: '添加供应商' }
      },
      {
        path: 'billList',
        component: () => import('@/views/bill/BillList.vue'),
        meta: { title: '账单列表' }
      },
      {
        path: 'billAdd',
        component: () => import('@/views/bill/BillAdd.vue'),
        meta: { title: '添加账单' }
      }
    ]
  }

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
